package com.Qieces;

import java.awt.*;

/**
 * 马类
 *
 */
public class Horse extends Qiece {

    public Horse(int row,int col,int c) {
        this.x = (col-1)*90 + 62;
        this.y = (row-1)*90 + 20;
        this.controller = c;
        this.kind = 5;
        this.scl = 0;
        this.moveof = 0;
    }

    public Horse(Qiece a,int index,int c){

        if (index == 0){
            this.kind = 5;
            this.x = a.x;
            this.y = a.y;
            this.controller = c;
            this.moveof = 0;
        }else if (index == 1){
            this.kind = a.kind;
            this.controller = a.controller;
        }
        this.scl = 0;
    }

    @Override
    public void paintSelf(Graphics g) {
        if(this.controller == 0 && this.kind !=0){           //为黑子时
            g.drawImage(horses_b,x,y,null);
        } else if(this.controller == 1 && this.kind !=0){    //为红子时
            g.drawImage(horses_r,x,y,null);
        }
        if(this.moveof == 1){
            g.drawImage(point,x+10,y+10,null);
        }
    }

    @Override
    public boolean select(int x, int y){
        return false;
    }

    @Override
    public void movingRange(Qiece[] qieces, int row, int col) {
        ;
    }
}
